import { createRequest } from '/@/api/service';
const module = 'ib/equipment/v1/AssetChangeHandleApi/';

/**
 * @function 设备处置——列表查询
 * @param data
 * @param header
 * @returns
 */
function QUERY_CHANGE_HANDLE_LIST(
  data: AssetChangeHandleApi.QueryChangeHandleListReq,
  header: object = {},
): Promise<AssetChangeHandleApi.QueryChangeHandleListResp> {
  return createRequest(
    `${process.env.APP_API_URL}${module}queryChangeHandleList`,
    data,
    header,
    'POST',
  );
}

/**
 * @function 处置归还——新增处置
 * @param data
 * @param header
 * @returns
 */
function INSERT_CHANGE_HANDLE(
  data: AssetChangeHandleApi.InsertChangeHandleReq,
  header: object = {},
): Promise<AssetChangeHandleApi.InsertChangeHandleResp> {
  return createRequest(
    `${process.env.APP_API_URL}${module}insertChangeHandle`,
    data,
    header,
    'POST',
  );
}

/**
 * @function 处置归还—查看详情
 * @param data
 * @param header
 * @returns
 */
function QUERY_CHANGE_HANDLE_DETAIL(
  data: AssetChangeHandleApi.QueryChangeHandleDetailReq,
  header: object = {},
): Promise<AssetChangeHandleApi.QueryChangeHandleDetailResp> {
  return createRequest(
    `${process.env.APP_API_URL}${module}queryChangeHandleDetail`,
    data,
    header,
    'POST',
  );
}

/**
 * @function 处置归还—查看详情
 * @param data
 * @param header
 * @returns
 */
function APPROVAL_CHANGE_HANDLE(
  data: AssetChangeHandleApi.ApprovalChangeHandleReq,
  header: object = {},
): Promise<AssetChangeHandleApi.ApprovalChangeHandleResp> {
  return createRequest(
    `${process.env.APP_API_URL}${module}approvalChangeHandle`,
    data,
    header,
    'POST',
  );
}

export {
  QUERY_CHANGE_HANDLE_LIST,
  INSERT_CHANGE_HANDLE,
  QUERY_CHANGE_HANDLE_DETAIL,
  APPROVAL_CHANGE_HANDLE,
};
